package com.turman.course

class NetResult<out T>(val status: Status, val data: T?, val message: String?) {
    companion object {
        fun <T> success(data: T?) = NetResult(Status.SUCCESS, data, null)
        fun <T> error(msg: String?, data: T?) = NetResult(Status.ERROR, data, msg)
        fun <T> loading(data: T?) = NetResult(Status.LOADING, data, null)
    }
}

enum class Status {
    SUCCESS,
    ERROR,
    LOADING
}